#pragma once
#include "GridTeam.h"
#include <iostream>
#include <fstream>
using namespace std;

class SudokuSolver
{
public:
	SudokuSolver(TeamType S, SudokuType T);
	virtual ~SudokuSolver(void);

	SingleGrid m_Grid[g_cnTeamSize][g_cnTeamSize];
	GridTeam m_RowTeam[g_cnTeamSize];
	GridTeam m_ColTeam[g_cnTeamSize];
	GridTeam m_BlockTeam[g_cnTeamSize];
	GridTeam *m_pExtraTeam;

	SudokuSolver(TeamType S, SudokuType T, const char* filename);
	int SolveStep(void);
	int CalcCount(void);
	GridTeam* GetTeam(int index);

	friend ostream &operator<<(ostream &os, const SudokuSolver &ss);

protected:
	TeamType m_nT;
	SudokuType m_nS;
	int m_nTeamSize;
	int IntialTeam(void);
	
	int TrySingle(void);
public:
	SudokuSolver(const char* filename);
	int TextAnalyzer(ifstream& inf);
};
